﻿using System;
using System.Collections;


namespace BizElements.BusinessLayer
{
    /// <summary>
    /// Collection of <see cref="IBindableField"/> objects.
    /// </summary>
    public interface IBindableFieldCollection : IEnumerable
    {
        #region Properties and indexers.

        /// <summary>
        /// Searches the collection for the field with the specified <see cref="IBindableField.BindingName"/>.
        /// </summary>
        /// <param name="bindingName">Name of the bound property.</param>
        /// <returns>Specified field or <b>null</b> if a field with the given name is not found in the collection.</returns>
        IBindableField this[string bindingName] { get; }

        /// <summary>
        /// Gets the element at the specified index.
        /// </summary>
        /// <param name="index">The zero-based index of the element to get or set. </param>
        /// <returns>The element at the specified index.</returns>
        IBindableField this[int index] { get; }

        /// <summary>
        /// Gets the number of elements actually contained in the collection.
        /// </summary>
        int Count { get; }

        #endregion
    }
}